package wechat.base.snd.util;

import com.google.common.base.Objects;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import org.eclipse.xtend.lib.Property;
import org.eclipse.xtext.xbase.lib.Exceptions;
import org.eclipse.xtext.xbase.lib.Pure;

@SuppressWarnings("all")
public class ConfProperty {
  @Property
  private Properties _prop;
  
  @Property
  private String _urlPath;
  
  public ConfProperty(final String fileName) {
    Properties _properties = new Properties();
    this.setProp(_properties);
    InputStream input = null;
    try {
      Class<? extends ConfProperty> _class = this.getClass();
      InputStream _resourceAsStream = _class.getResourceAsStream(fileName);
      input = _resourceAsStream;
      Properties _prop = this.getProp();
      _prop.load(input);
      Properties _prop_1 = this.getProp();
      String _property = _prop_1.getProperty("urlpath");
      this.setUrlPath(_property);
    } catch (final Throwable _t) {
      if (_t instanceof IOException) {
        final IOException ex = (IOException)_t;
        ex.printStackTrace();
      } else {
        throw Exceptions.sneakyThrow(_t);
      }
    } finally {
      boolean _notEquals = (!Objects.equal(input, null));
      if (_notEquals) {
        try {
          input.close();
        } catch (final Throwable _t_1) {
          if (_t_1 instanceof IOException) {
            final IOException e = (IOException)_t_1;
            e.printStackTrace();
          } else {
            throw Exceptions.sneakyThrow(_t_1);
          }
        }
      }
    }
  }
  
  @Pure
  public Properties getProp() {
    return this._prop;
  }
  
  public void setProp(final Properties prop) {
    this._prop = prop;
  }
  
  @Pure
  public String getUrlPath() {
    return this._urlPath;
  }
  
  public void setUrlPath(final String urlPath) {
    this._urlPath = urlPath;
  }
}
